<?php
 
//namespace Pear;

/**
 * This is Pager class from Pear_Pager
 *
 * @category  HTML
 * @package   Pager
 * @author    Lorenzo Alberton <l.alberton@quipo.it>
 * @author    Richard Heyes <richard@phpguru.org>
 * @copyright 2003-2008 Lorenzo Alberton, Richard Heyes
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
 * @link      http://pear.php.net/package/Pager
 *
 */
class Pager
{
	/**
	 * Return a pager based on $mode and $options
	 *
	 * @param array $options Optional parameters for the storage class
	 *
	 * @return object Storage object
	 * @static
	 * @access public
	 */
	public static function factory($options = array())
	{
		$mode = (isset($options['mode']) ? ucfirst($options['mode']) : 'Jumping');
		$classname = 'Pager_' . $mode;
		$classfile = DIRECTORY_SEPARATOR.'Pager' .DIRECTORY_SEPARATOR. $mode . '.php';
		$common = DIRECTORY_SEPARATOR.'Pager' .DIRECTORY_SEPARATOR. 'Common.php';

		include_once(STUDYBUDDY_PATH.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Pear'.$classfile);
		$pager = new $classname($options);

		return $pager;
	}

}
